import {Client} from "../Client";
import shortid = require("shortid");
import * as WebSocket from 'ws'

class SessionManager {

  clientsMap: Map<string, Client> = new Map<string, Client>();

  joinClient(ws: WebSocket) {
    const client = new Client();
    client.sessionId = shortid.generate();
    client.ws = ws;
    this.clientsMap.set(client.sessionId, client);
    return client;
  }
}

export const sessionManager = new SessionManager();